package com.woniuxy01;

import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-08-28 9:54
 */
public class Test06 {
    public static void main(String[] args) {


        Scanner sc = new Scanner(System.in);
        //产生随机数
        int random=(int)(Math.random()*100);
        System.out.println("random="+random);
        int num=-1;

        for(;num!=random;){
            System.out.println("输入你猜到数字");
            num=sc.nextInt();
            if(num>random){
                System.out.println("猜大了");
            }else if(num<random){
                System.out.println("猜小了");
            }else{
                System.out.println("猜对了");
            }
        }

        System.out.println("游戏结束");



    }
}
